package com.ebt.m.utils;

import com.ebt.m.AppContext;
import com.ebt.m.data.bean.UserInfo;
import com.tendcloud.tenddata.TCAgent;

import java.util.HashMap;

/**
 * Created by andy.wang on 2016/12/29.
 */

public class TalkingDataUtil {

    public static final String TYPE_BOTTOMBAR = "bottom_icon";
    public static final String TYPE_BOOTOM_PLUS = "bottom_plus";
    public static final String TYPE_BO_TRACE = "bo_trace";
    public static final String TYPE_BO_READ = "bo_read";
    public static final String TYPE_TASK_DIAL = "task_dial";
    public static final String TYPE_TASK_POLICY = "task_policy";
    public static final String TYPE_REGISTER = "register";
    public static final String TYPE_LOGIN = "login";
    public static final String TYPE_LOGIN_WECHAT = "login_wechat";
    public static final String TYPE_LOGIN_WEIBO = "login_weibo";
    public static final String TYPE_LOGIN_QQ = "login_qq";
    public static final String TYPE_FORGET_PWD = "forget_pwd";
    public static final String TYPE_RESET_PWD = "reset_pwd";
    public static final String TYPE_FEEDBACK = "feedback";
    public static final String TYPE_SUBMIT_FEEDBACK = "submit_feedback";
    public static final String TYPE_VERSION_CHECK = "version_check";
    public static final String TYPE_EDIT_CARD = "edit_card";
    public static final String TYPE_SHARE_CARD = "share_card";
    public static final String TYPE_CANCEL_CERTIFICATION = "cancel_certification";

    public static final String TYPE_CUSTOMER_SEARCH = "customer_search";//搜索客户
    public static final String TYPE_CUSTOMER_ADD = "customer_add";//手动新建客户
    public static final String TYPE_CUSTOMER_IMPORT = "customer_import";//通讯录导入客户
    public static final String TYPE_ACTIVE_CUSTOMER = "active_customer";//最近30天活动客户
    public static final String TYPE_CUSTOMER_FAB_CLICK = "customer_fab_click";//客户模块悬浮加号按钮用Label记录点击的子按钮

    public static final String TYPE_COMPANY_MODE_SEARCH_CLICK = "company_mode_search_click";
    public static final String TYPE_SEARCH_BRAND_FILTER = "search_brand_filter";
    public static final String TYPE_SEARCH_MAIN_ATTACH_FILTER = "search_main_attach_filter";
    public static final String TYPE_SEARCH_DIVIDEND_FILTER = "search_dividend_filter";


    public static final String TYPE_TOOL_PROPOSAL_CLICK = "tool_proposal_click";//认证模式中工具页面里计划书点击
    public static final String TYPE_ALL_LIST_MORE = "all_list_more";//全部列表中点击更多

    public static final String TYPE_OPEN_PRODOCT_V270 = "open_product_v270";//首页打开产品
    public static final String TYPE_APP_PROPOSAL_V270 = "app_proposal_v270";//应用页面点击“计划书”
    public static final String TYPE_APP_WIKI_V270 = "app_wiki_v270";//应用页面点击“寿险百科”
    public static final String TYPE_APP_SERVICE_V270 = "app_service_v270";//应用页面点击各个“服务查询”
    public static final String TYPE_APP_ZHANYE_V270 = "app_zhanye_v270";//应用页面点击各个“展业应用”
    public static final String TYPE_PROPOSAL_LIST_NEW_V270 = "proposal_list_new_v270";//计划书列表页面点击“新建”

    public static final String TYPE_BOTTOM_ICON_FIRST_PAGE_V270 = "bottom_icon_first_page_v270";//首页底部按钮“首页”
    public static final String TYPE_BOTTOM_ICON_CUSTOMER_V270 = "bottom_icon_customer_v270";//首页底部按钮“客户”
    public static final String TYPE_BOTTOM_ICON_APP_V270 = "bottom_icon_app_v270";//首页底部按钮“应用”
    public static final String TYPE_BOTTOM_ICON_MINE_V270 = "bottom_icon_mine_v270";//首页底部按钮“我的”
    public static final String TYPE_BOTTOM_PLUS_PROPOSAL_V270 = "bottom_plus_proposal_v270";//底部加号点击“计划书”
    public static final String TYPE_BOTTOM_PLUS_CUSTOMER_V270 = "bottom_plus_customer_v270";//底部加号点击“客户”
    public static final String TYPE_DASHBOADD_V270 = "dashboard_v270";//首页仪表盘点击
    public static final String TYPE_MESSAGE_CENTER_v270 = "message_center_v270";//首页消息中心点击

    public static void onEvent(String type) {
        TCAgent.onEvent(AppContext.getInstance(), type);
    }

    public static void onEvent(String type, String label) {
        TCAgent.onEvent(AppContext.getInstance(), type, label);
    }

    public static void onEventWithLabel(String type, String label) {
        TCAgent.onEvent(AppContext.getInstance(), type, label);
    }

    public static void onEventWithParams(String type, HashMap map) {
        TCAgent.onEvent(AppContext.getInstance(), type, "", map);
    }

    public static void onEventWithParamsAndLabel(String type, HashMap map, String label) {
        TCAgent.onEvent(AppContext.getInstance(), type, label, map);
    }

    public static void onEventWithAgentId(String type) {
        HashMap kv = new HashMap();
        UserInfo userInfo = AppContext.getCurrentUser();
        kv.put("agentId", String.valueOf(userInfo.getUserId()));
        TCAgent.onEvent(AppContext.getInstance(), type, "", kv);
    }
}
